
# g++ -O3 -fPIC -c alg_ftp.cc
# g++ -shared -Wl,-soname,alg-ftp.so.1 -lc -o alg-ftp.so alg_ftp.o
macro(add_alg_plugin name)
    cmake_parse_arguments(PLUGIN
            ""
            ""
            "SOURCES;COMPILE_FLAGS"
            ${ARGN}
            )
    set(plugin_name alg-${name})
    add_library(${plugin_name} SHARED ${PLUGIN_SOURCES})
    set_target_properties(${plugin_name} PROPERTIES NO_SONAME 1)
    set_target_properties(${plugin_name} PROPERTIES PREFIX "")
    if (PLUGIN_COMPILE_FLAGS)
        target_compile_options(${plugin_name} PRIVATE ${PLUGIN_COMPILE_FLAGS})
    endif()
    target_link_options(${plugin_name} PRIVATE -Wl,-soname,${plugin_name}.so.1)
endmacro()
